import { IsBoolean, IsNumber, IsOptional, IsString } from 'class-validator';

export class CreateArticleDto {
  @IsString()
  readonly title: string;

  @IsString()
  readonly description: string;

  @IsString()
  readonly content: string;

  @IsString()
  @IsOptional()
  readonly cover?: string;

  @IsNumber()
  @IsOptional()
  readonly status?: number = 1;

  @IsNumber()
  @IsOptional()
  readonly sort?: number = 0;

  @IsBoolean()
  @IsOptional()
  readonly top?: boolean = false;

  @IsNumber()
  @IsOptional()
  readonly browse?: number;

  @IsNumber()
  @IsOptional()
  readonly likes?: number;

  @IsString()
  readonly authorId: string;

  @IsString({ each: true })
  readonly tags: string[];

  @IsString()
  readonly category: string;
}
